package cn.sylinx.horm.type.derby;

import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import cn.sylinx.horm.type.JdbcType;
import cn.sylinx.horm.type.handler.UnknownTypeHandler;

public class DerbyUnknownTypeHandler extends UnknownTypeHandler {

    private static final DerbyObjectTypeHandler OBJECT_TYPE_HANDLER = new DerbyObjectTypeHandler();

    @Override
    public void setParameter(PreparedStatement ps, int i, Object parameter) throws SQLException {
        OBJECT_TYPE_HANDLER.setParameter(ps, i, parameter);
    }

    @Override
    protected JdbcType getJdbcTypeMapper() {
        return OBJECT_TYPE_HANDLER.getJdbcTypeMapper();
    }

    @Override
    public void setNonNullParameter(PreparedStatement ps, int i, Object parameter) throws SQLException {
        OBJECT_TYPE_HANDLER.setNonNullParameter(ps, i, parameter);
    }

    @Override
    public Object getNullableResult(ResultSet rs, String columnName) throws SQLException {
        return OBJECT_TYPE_HANDLER.getNullableResult(rs, columnName);
    }

    @Override
    public Object getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
        return OBJECT_TYPE_HANDLER.getNullableResult(rs, columnIndex);
    }

    @Override
    public Object getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
        return OBJECT_TYPE_HANDLER.getNullableResult(cs, columnIndex);
    }

}
